package com.ideasindustry.photoontaje.service.providers;

public class Tag {
	
	/**
	 * Default Constructor
	 */
	public Tag() {

	}
	
	/**
	 * @param key
	 *            the key to set
	 * @param mandatory
	 *            is tag required?
	 */
	public Tag(String key, Boolean mandatory) {
		super();
		this.key = key;
		this.mandatory = mandatory;
	}
	
	/**
	 * @param key
	 *            the key to set
	 * @param value
	 *            the value to set
	 */
	public Tag(String key, String value) {
		super();
		this.key = key;
		this.value = value;
	}


	private String key;

	private String value;

	private Boolean mandatory;

	/**
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value
	 *            the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * @return the mandatory
	 */
	public Boolean getMandatory() {
		return mandatory;
	}

	/**
	 * @param mandatory
	 *            is tag required?
	 */
	public void setMandatory(Boolean mandatory) {
		this.mandatory = mandatory;
	}
	
	public boolean equals(Object tag){
		Boolean result = false;
		if (tag!=null && tag instanceof Tag && ((Tag)tag).getKey().equals(getKey())){
			result = true;
		}
		return result;
	}

}
